package self.niu.com.resume.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;

import java.util.List;

import self.niu.com.resume.R;
import self.niu.com.resume.db.Projects;

/**
 * Created by Administrator on 2015/9/28 0028.
 */
public class ProjectListAdapter extends MyBaseAdapter {
    private List<Projects> list;

    public ProjectListAdapter(Context context, List list) {
        super(context, list);
        this.list = list;
    }

    @Override
    public View getItemView(int position, View view, ViewGroup parent) {
        ViewHoldre vh;
        if (view == null) {
            view = inflate.inflate(R.layout.activity_yu_wei, null);
            vh = new ViewHoldre(view);
            view.setTag(vh);
        } else {
            vh = (ViewHoldre) view.getTag();
        }
        Projects pro = list.get(position);
        vh.proName.setText(pro.getProName());
        vh.proSummary.setText(pro.getProSummary());
        vh.proTime.setText(pro.getProTime());
        vh.proTechnic.setText(pro.getProTechnic());
        vh.proTool.setText(pro.getProTool());
        switch (pro.getProImageid()) {
            case "0":
                break;
            case "1":
                break;
            case "2":
                break;
            case "3":
                break;
        }


        return view;
    }

    public static class ViewHoldre {
        @ViewInject(R.id.pro_name_tv)
        private TextView proName;
        @ViewInject(R.id.pro_time_tv)
        private TextView proTime;
        @ViewInject(R.id.pro_tool_tv)
        private TextView proTool;
        @ViewInject(R.id.pro_summary_tv)
        private TextView proSummary;
        @ViewInject(R.id.pro_technic_tv)
        private TextView proTechnic;
        @ViewInject(R.id.project_image1_iv)
        private TextView imag1;
        @ViewInject(R.id.project_image2_iv)
        private TextView imag2;

        public ViewHoldre(View view) {
            ViewUtils.inject(this, view);
        }
    }
}
